const movie = "https://m.douban.com/rexxar/api/v2/subject_collection/movie_showing/items?count=10"
const tv = "https://m.douban.com/rexxar/api/v2/subject_collection/tv_hot/items?count=10"
const variety = "https://m.douban.com/rexxar/api/v2/subject_collection/tv_variety_show/items?count=10"
Page({
  data:{
    title:''
  },
  input(e){
    console.log(e);
    this.setData({
      title:e.detail.value
    })
  },
  search(){
    console.log('s');
    wx.navigateTo({
      url: 'search?title='+this.data.title,
    })
  },
onLoad(){
  wx:wx.request({
    url:movie,
    success: (res) => {
      // console.log(res);
      this.setData({
        movielist:res.data.subject_collection_items
      })
      console.log(this.data.movielist)
    }
  })
  
  wx.request({
    url: tv,
    success:(res)=>{
      console.log(res);
      this.setData({
        tvlist:res.data.subject_collection_items
      })
      console.log(this.data.tvlist)
    }
  })
  wx.request({
    url: variety,
    success:(res)=>{
      console.log(res);
      this.setData({
        varietylist:res.data.subject_collection_items
      })
      console.log(this.data.varietylist)
    }
  })
}
})